import { createBrowserRouter } from 'react-router-dom';
import Layout from '../components/Layout';
import HomePage from '../pages/HomePage';
import MessagesPage from '../pages/MessagesPage';
import OrdersPage from '../pages/OrdersPage';
import DoctorDetailPage from '../pages/DoctorDetailPage';
import ConsultationPage from '../pages/ConsultationPage';
import OnlineConsultationPage from '../pages/OnlineConsultationPage';
import ProfilePage from '../pages/ProfilePage';
import SettingsPage from '../pages/SettingsPage';
import LoginPage from '../pages/LoginPage';

// 导入新页面组件（这些页面需要创建）
import HealthRecordsPage from '../pages/HealthRecordsPage';
import MedicationAdvicePage from '../pages/MedicationAdvicePage';
import PreferredOrdersPage from '../pages/PreferredOrdersPage';
import MyDoctorPage from '../pages/MyDoctorPage';
import FollowUpPlanPage from '../pages/FollowUpPlanPage';
import ShippingAddressPage from '../pages/ShippingAddressPage';
import MyCouponsPage from '../pages/MyCouponsPage';
import OutpatientAppointmentPage from '../pages/OutpatientAppointmentPage';
import PriceDisclosurePage from '../pages/PriceDisclosurePage';
import FeedbackPage from '../pages/FeedbackPage';
import UserAgreementPage from '../pages/UserAgreementPage';
import PrivacyPolicyPage from '../pages/PrivacyPolicyPage';

// 导入搜索相关页面
import HospitalDetailPage from '../pages/HospitalDetailPage';
import MedicineDetailPage from '../pages/MedicineDetailPage';
import SymptomDetailPage from '../pages/SymptomDetailPage';
import SearchPage from '../pages/SearchPage';

// 导入测试页面
import TestFollowPage from '../pages/TestFollowPage';

export const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        index: true,
        element: <HomePage />,
      },
      {
        path: 'messages',
        element: <MessagesPage />,
      },
      {
        path: 'orders',
        element: <OrdersPage />,
      },
      {
        path: 'doctor/:doctorId',
        element: <DoctorDetailPage />,
      },
      {
        path: 'consultation/:doctorId',
        element: <ConsultationPage />,
      },
      {
        path: 'consultation',
        element: <ConsultationPage />,
      },
      {
        path: 'online-consultation',
        element: <OnlineConsultationPage />,
      },
      {
        path: 'profile',
        element: <ProfilePage />,
      },
      {
        path: 'settings',
        element: <SettingsPage />,
      },
      {
        path: 'login',
        element: <LoginPage />,
      },
      {
        path: 'search',
        element: <SearchPage />,
      },
      // 新增页面路由
      {
        path: 'health-records',
        element: <HealthRecordsPage />,
      },
      {
        path: 'medication-advice',
        element: <MedicationAdvicePage />,
      },
      {
        path: 'preferred-orders',
        element: <PreferredOrdersPage />,
      },
      {
        path: 'my-doctor',
        element: <MyDoctorPage />,
      },
      {
        path: 'follow-up-plan',
        element: <FollowUpPlanPage />,
      },
      {
        path: 'shipping-address',
        element: <ShippingAddressPage />,
      },
      {
        path: 'my-coupons',
        element: <MyCouponsPage />,
      },
      {
        path: 'outpatient-appointment',
        element: <OutpatientAppointmentPage />,
      },
      {
        path: 'price-disclosure',
        element: <PriceDisclosurePage />,
      },
      {
        path: 'feedback',
        element: <FeedbackPage />,
      },
      {
        path: 'user-agreement',
        element: <UserAgreementPage />,
      },
      {
        path: 'privacy-policy',
        element: <PrivacyPolicyPage />,
      },
      // 搜索相关页面路由
      {
        path: 'hospital/:id',
        element: <HospitalDetailPage />,
      },
      {
        path: 'medicine/:medicineId',
        element: <MedicineDetailPage />,
      },
      {
        path: 'symptom/:symptomId',
        element: <SymptomDetailPage />,
      },
      {
        path: 'test-follow',
        element: <TestFollowPage />,
      },
    ],
  },
]);

export default router; 